//////////////////////////////////////////////////////////////////////////
//
// PROJECT:     Small and fast HTTP server
// FILE:        HTTPServerSession.h
// CREATED:     25-Dec-2013
// AUTHOR:      Vladimir Gumenuk
// DESCRIPTION: 
// REVISION:    0.0.0.1
//
//////////////////////////////////////////////////////////////////////////

#pragma once

//////////////////////////////////////////////////////////////////////////
//
class CHTTPServerSession : public CSimpleThread
{
public:
    CHTTPServerSession();
    virtual ~CHTTPServerSession();

    HRESULT Initialize();
    HRESULT Uninitialize();

    HRESULT Start();
    HRESULT Stop();

private:
    virtual void  Run();
    DWORD DoReceiveRequests();
    DWORD SendHttpResponse( IN PHTTP_REQUEST pRequest, IN USHORT StatusCode, IN PSTR pReason, IN PSTR pEntityString );
    DWORD SendHttpPostResponse( IN PHTTP_REQUEST pRequest );

    HTTP_SERVER_SESSION_ID      m_httpSessionID;
    HANDLE                      m_hRequestQueue;
    HTTP_URL_GROUP_ID           m_hUrlGroupID;
};

